package com.ocean.web.controller.business;

import com.ocean.business.service.IBusinessMySQLDataTransitionService;
import com.ocean.common.core.controller.BaseController;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: FuGui Wang
 * @Description: TODO 后台系统-mysql数据处理-前端控制器
 * @Date 2022/12/5
 * @Version V1.1.0
 */
@Slf4j
@RestController
@RequestMapping("/transition")
public class BusinessMySQLDataTransitionController extends BaseController {
    @Autowired
    private IBusinessMySQLDataTransitionService mySQLDataTransitionService;

    /**
     * 将云平台组织数据存到若依表中
     */
    @PostMapping("/dataTransitionDept")
    @ApiOperation(value = "数据转换-组织表 sys_dept")
    public void dataTransitionDept() {
        mySQLDataTransitionService.dataTransitionDept();
    }

    /**
     * 将云平台产品&组织关联数据存到若依表中
     */
    @PostMapping("/dataTransitionProductDept")
    @ApiOperation(value = "数据转换-产品组织中间表 o_product_dept")
    public void dataTransitionProductDept() {
        mySQLDataTransitionService.dataTransitionProductDept();
    }

    /**
     * 将云平台用户数据存到若依表中（暂未开发完成，密码无法完成解密）
     */
    @PostMapping("/dataTransitionSysUser")
    @ApiOperation(value = "数据转换-用户表 t_s_base_user")
    public void dataTransitionSysUser() {
        mySQLDataTransitionService.dataTransitionSysUser();
    }
}